/**
 * 功能:TK_REF_GOODS Dao类
 * 开发人员:chengd
 * 创建时间:2012/4/23 22:30:16
 */
package com.towker.frame.dao.sell;

import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;
import com.towker.core.db.BaseDao;
import com.towker.frame.model.sell.RefGoods;

@Repository
@SuppressWarnings("unchecked")
public class RefGoodsDao extends BaseDao<RefGoods, Long>
{
	@Override
	public Class getEntityClass()
	{
		return RefGoods.class;
	}
	
	public List<RefGoods> getByInfoType(Integer infoType, Integer infoId) {
		String statementName = getIbatisMapperNamespace() + ".getByInfoType";
		Map params = new TreeMap<String, Object>();
		params.put("infoType", infoType);
		params.put("infoId", infoId);
		return getSqlSessionTemplate().selectList(statementName, params);
	}

	public void deleteByInfoType(Integer infoType, Integer infoId) {
		String statementName = getIbatisMapperNamespace() + ".deleteByInfoType";
		Map params = new TreeMap<String, Object>();
		params.put("infoType", infoType);
		params.put("infoId", infoId);
		getSqlSessionTemplate().delete(statementName, params);
	}
}